<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>LIF041-Infographie:  Fichier source de /home/the-king/LIFO41/lifo41-tp-infographie/Image.h</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Généré par Doxygen 1.7.4 -->
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">LIF041-Infographie</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Page&#160;principale</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Fichiers</span></a></li>
      <li><a href="dirs.html"><span>Répertoires</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>Liste&#160;des&#160;fichiers</span></a></li>
      <li><a href="globals.html"><span>Membres&#160;de&#160;fichier</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('_image_8h.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">/home/the-king/LIFO41/lifo41-tp-infographie/Image.h</div>  </div>
</div>
<div class="contents">
<a href="_image_8h.html">Aller à la documentation de ce fichier.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef IMAGE_H_INCLUDED</span>
<a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define IMAGE_H_INCLUDED</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span>
<a name="l00004"></a>00004 
<a name="l00005"></a>00005 
<a name="l00007"></a><a class="code" href="structs_image.html">00007</a> <span class="keyword">struct </span><a class="code" href="structs_image.html" title="An image is defined by Width, Height, a number of Color and the data.">sImage</a>
<a name="l00008"></a>00008 {
<a name="l00009"></a><a class="code" href="structs_image.html#aa6f9954c2c570315820119012e7ea1dd">00009</a>     <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>* <a class="code" href="structs_image.html#aa6f9954c2c570315820119012e7ea1dd">data</a>;
<a name="l00010"></a><a class="code" href="structs_image.html#adb2d38c3505ca0be7cb014f64a302cbe">00010</a>     <span class="keywordtype">int</span> <a class="code" href="structs_image.html#adb2d38c3505ca0be7cb014f64a302cbe">dimx</a>;
<a name="l00011"></a><a class="code" href="structs_image.html#a14c6823faa298b6c3d0767bd9ffaa769">00011</a>     <span class="keywordtype">int</span> <a class="code" href="structs_image.html#a14c6823faa298b6c3d0767bd9ffaa769">dimy</a>;
<a name="l00012"></a><a class="code" href="structs_image.html#ae55dcd7590bd5f1a78b22081d6a82b19">00012</a>     <span class="keywordtype">int</span> <a class="code" href="structs_image.html#ae55dcd7590bd5f1a78b22081d6a82b19">dimc</a>;
<a name="l00013"></a>00013 };
<a name="l00014"></a><a class="code" href="_image_8h.html#ab72e0add99249d8514a61331c1ae8227">00014</a> <span class="keyword">typedef</span> <span class="keyword">struct  </span><a class="code" href="structs_image.html" title="An image is defined by Width, Height, a number of Color and the data.">sImage</a>  <a class="code" href="structs_image.html" title="An image is defined by Width, Height, a number of Color and the data.">Image</a>;
<a name="l00015"></a>00015 
<a name="l00017"></a>00017 <span class="keywordtype">void</span> <a class="code" href="_image_8cpp.html#abb66606a1482a97fc8b6b1406915d66a" title="Init an black image.">imInit</a>(<a class="code" href="structs_image.html" title="An image is defined by Width, Height, a number of Color and the data.">Image</a> &amp;im, <span class="keyword">const</span> <span class="keywordtype">int</span> dx, <span class="keyword">const</span> <span class="keywordtype">int</span> dy, <span class="keyword">const</span> <span class="keywordtype">int</span> dc);
<a name="l00018"></a>00018 
<a name="l00020"></a>00020 <span class="keywordtype">void</span> <a class="code" href="_image_8cpp.html#afe9188b950fd511ec9fca79eeda79185" title="Init an image from a PPM file.">imInitPPM</a>(<a class="code" href="structs_image.html" title="An image is defined by Width, Height, a number of Color and the data.">Image</a>&amp; im, <span class="keyword">const</span> <span class="keywordtype">char</span> filename[]);
<a name="l00021"></a>00021 
<a name="l00023"></a>00023 <span class="keywordtype">void</span> <a class="code" href="_image_8cpp.html#a88d4f73f024fbaba6faca480f99be02e" title="Add transparency to an image: all white pixels (R=255,G=255,B=255) get transparent.">imCreateTransparency</a>(<a class="code" href="structs_image.html" title="An image is defined by Width, Height, a number of Color and the data.">Image</a>&amp; im);
<a name="l00024"></a>00024 
<a name="l00026"></a>00026 <span class="keywordtype">void</span> <a class="code" href="_image_8cpp.html#a59fc5c81ae684d0bc9604d51fd8bab0d" title="Free memory.">imFree</a>(<a class="code" href="structs_image.html" title="An image is defined by Width, Height, a number of Color and the data.">Image</a>&amp; im);
<a name="l00027"></a>00027 
<a name="l00029"></a>00029 <span class="keywordtype">int</span> <a class="code" href="_image_8cpp.html#afe1e8e9172d457511dcb7edaeee9ccdb" title="return Weight of the image">imGetDimX</a>(<span class="keyword">const</span> <a class="code" href="structs_image.html" title="An image is defined by Width, Height, a number of Color and the data.">Image</a>&amp; im);
<a name="l00030"></a>00030 
<a name="l00032"></a>00032 <span class="keywordtype">int</span> <a class="code" href="_image_8cpp.html#a77b9e9fd96c4f01ff5427b66d2583afe" title="return Height of the image">imGetDimY</a>(<span class="keyword">const</span> <a class="code" href="structs_image.html" title="An image is defined by Width, Height, a number of Color and the data.">Image</a>&amp; im);
<a name="l00033"></a>00033 
<a name="l00035"></a>00035 <span class="keywordtype">int</span> <a class="code" href="_image_8cpp.html#a307ba5e3ceff8b428f855caf8b4e79ca" title="return number of colors of the image: 1=greyscale image; 3=RGB; 4=RGBA">imGetDimC</a>(<span class="keyword">const</span> <a class="code" href="structs_image.html" title="An image is defined by Width, Height, a number of Color and the data.">Image</a>&amp; im);
<a name="l00036"></a>00036 
<a name="l00038"></a>00038 <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>*  <a class="code" href="_image_8cpp.html#a7e71b294474d6a007cb502a11aae01a3" title="return pointer on data">imGetData</a>(<span class="keyword">const</span> <a class="code" href="structs_image.html" title="An image is defined by Width, Height, a number of Color and the data.">Image</a>&amp; im);
<a name="l00039"></a>00039 
<a name="l00041"></a>00041 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>&amp; <a class="code" href="_image_8cpp.html#a587db3306e9f8d42571984ed10fd712b" title="return the color value of a pixel (x,y); c=0 return R; c=1 return G; c=2 return B; c=4 return Alpha...">getPix</a>(<span class="keyword">const</span> <a class="code" href="structs_image.html" title="An image is defined by Width, Height, a number of Color and the data.">Image</a>&amp; im, <span class="keyword">const</span> <span class="keywordtype">int</span> x, <span class="keyword">const</span> <span class="keywordtype">int</span> y, <span class="keyword">const</span> <span class="keywordtype">int</span> c=0);
<a name="l00042"></a>00042 
<a name="l00044"></a>00044 <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>&amp; <a class="code" href="_image_8cpp.html#aa8c969bba0b30d935dd9ef4d16a0935e" title="return the color value of a pixel (x,y); c=0 return R; c=1 return G; c=2 return B; c=4 return Alpha...">getPixConst</a>(<span class="keyword">const</span> <a class="code" href="structs_image.html" title="An image is defined by Width, Height, a number of Color and the data.">Image</a>&amp; im, <span class="keyword">const</span> <span class="keywordtype">int</span> x, <span class="keyword">const</span> <span class="keywordtype">int</span> y, <span class="keyword">const</span> <span class="keywordtype">int</span> c=0);
<a name="l00045"></a>00045 
<a name="l00047"></a>00047 <span class="keywordtype">void</span> <a class="code" href="_image_8cpp.html#a24a645da11c0ee7b5871d02e496d7833" title="print size of the image">imPrintf</a>(<span class="keyword">const</span> <a class="code" href="structs_image.html" title="An image is defined by Width, Height, a number of Color and the data.">Image</a>&amp; im);
<a name="l00048"></a>00048 
<a name="l00050"></a>00050 <span class="keywordtype">bool</span> <a class="code" href="_image_8cpp.html#a5b5a3b61b5b59297cce86bb28d7442ec" title="true if (x,y) is into the image otherwise false">isCoordValid</a>(<span class="keyword">const</span> <a class="code" href="structs_image.html" title="An image is defined by Width, Height, a number of Color and the data.">Image</a>&amp; im, <span class="keyword">const</span> <span class="keywordtype">int</span> x, <span class="keyword">const</span> <span class="keywordtype">int</span> y);
<a name="l00051"></a>00051 
<a name="l00052"></a>00052 <span class="preprocessor">#endif // IMAGE_H_INCLUDED</span>
</pre></div></div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="_image_8h.html">Image.h</a>      </li>
      <li class="footer">Généré le Tue Jan 3 2012 09:33:59 pour LIF041-Infographie par&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </li>
    </ul>
  </div>

</body>
</html>
